home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / compak7 / dacpack7.exe / UserList.vbs < prev    next >
Encoding:
Text File  |  1998-08-21  |  900 b   |  34 lines

  1. L_Welcome_MsgBox_Message_Text    = "This script demonstrates DameWare UserList using the Windows Scripting Host."
  2. L_Welcome_MsgBox_Title_Text      = "DameWare Windows Scripting Host Sample"
  3. CrLf = chr(13) & chr(10)
  4. MyTab = chr(9)
  5.  
  6. Call Welcome()
  7.  
  8. Dim DCtl1
  9. Set DCtl1 = Wscript.CreateObject("DameWare.UserListCtl.1")
  10.  
  11. DCtl1.Machine = DCtl1.GetLocalMachineName
  12. DCtl1.SetFirstUser
  13.  
  14. Dim strUsers
  15.  
  16. While DCtl1.UserGetNext <> 0
  17.     strUsers = strUsers & DCtl1.UserName & MyTab & DCtl1.UserFullName & _
  18.             MyTab & DCtl1.Usercomment & CrLf
  19. Wend
  20.  
  21. MsgBox "User Information: "  & CrLf & strUsers
  22.  
  23. Set DCtl1 = Nothing
  24.  
  25. Sub Welcome()
  26.     Dim intDoIt
  27.  
  28.     intDoIt =  MsgBox(L_Welcome_MsgBox_Message_Text, _
  29.                       vbOKCancel + vbInformation,    _
  30.                       L_Welcome_MsgBox_Title_Text )
  31.     If intDoIt = vbCancel Then
  32.         WScript.Quit
  33.     End If
  34. End Sub